<?php
/**
 * This class declare common constants.
 *
 * @package core.includes 
 * @author hdviet
 * @version $Id:$
 * @copyright 2009 LHV Company
 */
class TrackingSystemManagement {
	
	/**
	 * 
	 * @param $userId
	 * @param $enumType
	 * @param $beforeChange
	 * @param $afterChange
	 * @return unknown_type
	 */
	public static function trackChanging($userId, $enumType, $tableName, $itemId, $beforeChange, $afterChange, $reason) {
		$trackingObj = Celini::newOrdo("TrackingSystem");
		$type = 0;
		try {
			$type = Utils::getEnumKey(EnumerationConstant::TRACKING_SYSTEM, $enumType);
			
		} catch (Exception $ex) {
			
		}
		$trackingObj->setData($userId, $type, $tableName, $itemId, $beforeChange, $afterChange, $reason);
		$trackingObj->persist();
	}
}
?>